<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>标书模板的维护</title>
    <meta name="decorator" content="footer"/>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
    <link href="${ctxStatic}/uploadify/uploadify.css" type="text/css" rel="stylesheet"/>
    <script src="${ctxStatic}/uploadify/jquery.uploadify.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            $("#file_upload").change(function(){
                $("#ctlImg").attr("src",$(".filename").html());
                console.log($(".filename").html());
            });
        });
        $(document).ready(function () {
            $('#file_upload').uploadify({
                'swf': '${ctxStatic}/uploadify/uploadify.swf',
                //'uploader'：若是上传路径
                'uploader': '${ctx}/oa/personSigns/saveContractFile',
                'buttonText': '请选择要上传的个人签名',
                'height': 25,
                'width': 150,
                'auto': false,
                'fileTypeExts': '*.*',
                "fileObjName": 'file',
                'multi': false,
                'onUploadSuccess': function (file, data, response) {
                    console.log(file);
                    //若是上传成功，跳转的页面
                     location.href = "${ctx}/oa/personSigns/list";
                },
                'onCancel': function () {
                    flag = false;
                },
                'onSelect': function () {
                    flag = true;
                },
                'onUploadStart': function (file) {
                    $("#file_upload").uploadify("settings", "formData", {
                        'name': $("#name").val(),'signName':$("#signName").val(),
                        'id':$("#id").val()
                    });
                }
            });
            $("#btnSubmit").on("click", function () {
                $('#file_upload').uploadify('upload', '*');
            })

        });



    </script>


</head>
<body>
<%--<div id="header">--%>
    <%--<h1>--%>
        <!--<a href="dashboard.html">极目云OA办公系统</a>-->
    <%--</h1>--%>
<%--</div>--%>
<div class="title_Infor">
    <a href="${ctx}/sys/user/myPhone" class="pull-left"><img src="${ctxStatic}/oaApp/img/liucheng_Icon/fanhui.png" />返回</a>
    <h3 >个人签名管理</h3>


</div>


<form:form id="inputForm" modelAttribute="personSigns" action="${ctx}/oa/personSigns/saveContractFile" method="post" class="form-horizontal" enctype="multipart/form-data">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <div class="control-group">
        <label class="control-label">姓名：</label>
        <div class="controls">
            <form:input path="name" htmlEscape="false" maxlength="100" class="input-xlarge "/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">签章名称：</label>
        <div class="controls">
            <form:input path="signName" htmlEscape="false" maxlength="100" class="input-xlarge "/>
        </div>
    </div>

    <div class="control-group">

        <label class="control-label">选择签名图片：</label>
        <p id="ctlOnlyP"><img src="" alt="图片" id="ctlImg"/></p>
        <div class="controls">
            <b>上传图片</b>
            <input type="file" class="btn btn-success" name="file_upload" id="file_upload" value="选择图片"/>
        </div>
    </div>
    <div class="form-actions" style="margin: 20px;padding-left: 10px;">
        <input id="btnSubmit" class="btn btn-primary" style="width: 260px" type="button" value="保 存"/>&nbsp;
        <input id="btnCancel" class="btn" type="button"style="width: 260px" value="返 回" onclick="history.go(-1)"/>
    </div>
</form:form>

</body>

</html>
